package com.chentf;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.core.env.Environment;

/**
 * @author chentengfei
 * @desc ...
 * @date 2021-09-19 19:56:11
 */
@SpringBootApplication
@EnableDiscoveryClient
public class ProductApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext run = SpringApplication.run(ProductApplication.class, args);
        Environment bean = run.getBean(Environment.class);
        System.out.println("端口号:"+bean.getProperty("server.port")+",项目名称:"+bean.getProperty("spring.application.name"));
    }
}
